import {createRouter, createWebHashHistory} from "vue-router";
import Axios from "../utils/request"
import AxiosOrigin from "axios";
import config from "../utils/config";
const routes = [
    {
        path: '/',
        redirect: '/controller'
    },
    {
        path: '/403',
        name: '403',
        meta: {
            title: '没有权限'
        },
        component: () => import (/* webpackChunkName: "404" */ '../views/403.vue')
    },
    {
        path: '/404',
        name: '404',
        meta: {
            title: '找不到页面'
        },
        component: () => import (/* webpackChunkName: "404" */ '../views/404.vue')
    },
    {
        path: '/controller',
        name: 'controller',
        meta: {
            title: '地热数据采集-控制面板'
        },
        component: () => import (/* webpackChunkName: "404" */ '../views/Dashboard.vue')
    }
];

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

const allow = ['/login','/','/icon','/printer']

router.beforeEach((to, from, next) => {
    document.title = to.meta.title;
    next()
});

export default router;
